/**
 * @description: 应用配置信息表
 * @version: 0.0.1
 * @author: z..
 * @Date: 2023-06-12 18:16:39
 */

import { Table, Model, Column, CreatedAt, UpdatedAt, DataType } from 'sequelize-typescript';

@Table({ tableName: 'robot_webapi_records' })
export class RobotWebapiRecords extends Model {
  @Column({
    primaryKey: true,       //主键
    autoIncrement: true,    //自增
    comment: "自增id"       //注释:只在代码中有效
  })
  id: number;

  @Column({
    type: DataType.TEXT,
    comment: "名称"
  })
  webapi_name: string;

  @Column({
    type: DataType.TEXT,
    comment: "内容"
  })
  webapi_content: string;
  
  @Column({
    type: DataType.TEXT,
    comment: "报警方式"
  })
  webapi_type: string;
  
  @Column({
    type: DataType.NUMBER,
    comment: "报警提前通知天数"
  })
  webapi_time: number;

  @Column({
    type: DataType.TEXT,
    comment: "报警结束时间"
  })
  webapi_endtime: string;

  @Column({
    type: DataType.TEXT,
    comment: "状态 未开始NOT_START,进行中START，结束END"
  })
  webapi_status: string;

  @Column({
    type: DataType.TEXT,
    comment: "负责人userid列表"
  })
  webapi_userid: string;

  @Column({
    type: DataType.TEXT,
    comment: "负责人名称列表"
  })
  webapi_username: string;

  @Column({
    type: DataType.TEXT,
    comment: "报警配置内容 钉钉机器人配置"
  })
  webapi_config: string;

  @Column({
    type: DataType.NUMBER,
    comment: "品牌id"
  })
  brand_id: number;

  @Column({
    type: DataType.TEXT,
    comment: "品牌名称"
  })
  brand_name: string;

  @Column({
    type: DataType.NUMBER,
    comment: "项目id"
  })
  project_id: number;

  @Column({
    type: DataType.TEXT,
    comment: "项目名称"
  })
  project_name: string;

  @Column({
    type: DataType.NUMBER,
    comment: "接口调用间隔时间"
  })
  testing_interval: number;

  @Column({
    type: DataType.NUMBER,
    comment: "是否成功时推送消息  0否，1是"
  })
  send_success_msg: number;

  @Column({
    type: DataType.TEXT,
    comment: "请求方式"
  })
  webapi_method: string;

  @Column({
    type: DataType.TEXT,
    comment: "api域名"
  })
  webapi_domain: string;

  @Column({
    type: DataType.TEXT,
    comment: "api路径"
  })
  webapi_path: string;

  @Column({
    type: DataType.TEXT,
    comment: "请求参数"
  })
  webapi_data: string;

  @Column({
    type: DataType.TEXT,
    comment: "api返回值校验内容"
  })
  webapi_check: string;

  @Column({
    type: DataType.TEXT,
    comment: "创建人id"
  })
  created_userid: string;

  @Column({
    type: DataType.TEXT,
    comment: "创建人名称"
  })
  created_username: string;

  @CreatedAt
  created_at: Date;

  @UpdatedAt
  updated_at: Date;
}